package forList;

import java.util.Arrays;

public class CopyOf {

    public static void main(String[] args) {

        int[] a = new int[4];
        a[0] = 0;
        a[1] = 1;
        a[2] = 2;
        a[3] = 3;

        int[] b = Arrays.copyOf(a, 10);
        int[] c = Arrays.copyOf(a, 3);

        for (int i : c) {
            System.out.print(i + "\t");
        }

        System.out.println();

        for (int i : b) {
            System.out.print(i + "\t");
        }

    }

}


